Context-Free Languages via Coalgebraic Trace Semantics
نویسندگان
چکیده
In this paper we identify context-free grammars as coalgebras. To obtain the associated context-free languages (consisting of only finite-length strings) we introduce a general and novel technique of finite trace semantics for coalgebras. It builds on top of the (possibly infinite) trace semantics introduced earlier by the second author, but extracts only finite behavior. Interestingly the finite trace is uniquely characterized corecursively and hence it yields a final coalgebra in a suitable Kleisli category, while the ordinary trace is not unique and yields a weakly final coalgebra. Additionally, the constructions of both finite and possibly infinite parse trees are shown to be monads. Hence our extension of the application domain of coalgebras identifies several new mathematical constructions and structures.
منابع مشابه
Finitary logics for coalgebras with branching
The purpose of this dissertation is to further previous work on coalgebras as infinite statebased transition systems and their logical characterisation with particular focus on infinite regular behaviour and branching. Finite trace semantics is well understood [DR95] for nondeterministic labelled transition systems, and has recently [Jac04, HJS06] been generalised to a coalgebraic level where m...
متن کاملCoalgebraic Characterizations of Context-Free Languages
In this article, we provide three coalgebraic characterizations of the class of context-free languages, each based on the idea of adding coalgebraic structure to an existing algebraic structure by specifying output-derivative pairs. Final coalgebra semantics then gives an interpretation function into the final coalgebra of all languages with the usual output and derivative operations. The first...
متن کاملCoalgebraic Trace Semantics via Forgetful Logics
We use modal logic as a framework for coalgebraic trace semantics, and show the flexibility of the approach with concrete examples such as the language semantics of weighted, alternating and tree automata, and the trace semantics of generative probabilistic systems. We provide a sufficient condition under which a logical semantics coincides with the trace semantics obtained via a given determin...
متن کاملContext-Free Languages, Coalgebraically
We give a coalgebraic account of context-free languages using the functor D(X) = 2 × X for deterministic automata over an alphabet A, in three different but equivalent ways: (i) by viewing context-free grammars as D-coalgebras; (ii) by defining a format for behavioural differential equations (w.r.t. D) for which the unique solutions are precisely the context-free languages; and (iii) as theD-co...
متن کاملTrace semantics via determinization for probabilistic transition systems
A coalgebraic definition of finite and infinite trace semantics for probabilistic transition systems has recently been given using a certain Kleisli category. In this paper this semantics is developed using a coalgebraic method which is an instance of general determinization. Once applied to discrete systems, this point of view allows the exploitation of the determinized structure by up-to tech...
متن کامل